﻿// Singleton class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Threading;
using System.Reflection;

namespace BinocularVision
{
    public class Robot
    {
        #region Singleton (static) members
        private static Robot instance;

        static Robot()
        {
            instance = new Robot();
        }

        static public Robot Instance
        {
            get { return instance; }
        }

        private Robot()
        {
        }
        #endregion

        #region Fields
        private string name;
        private Body body;
        private Brain brain;
        #endregion

        #region Public methods
        public void Initialize()
        {
            brain.Initialize();
            body.Initialize();
        }

        public void Start()
        {            
            brain.Start();
            body.Start();
        }

        public void Stop()
        {
            brain.Stop();
            body.Stop();
        }

        public void Disconnect()
        {
            body.Disconnect();
        }
        #endregion

        #region Properties
        public string Name
        {
            get { return name; }
            set { name = value; }
        }
        public Body Body
        {
            get { return body; }
            set { body = value; }
        }
            public Brain Brain
            {
                get { return brain; }
                set { brain = value; }
            } 
        #endregion
    }
}
